Xwrite

General Operation Statement

Syntax samples

XWRITE <file ID>, <string or numeric expression>

Description

Writes information to a general write file in any text format the user chooses. XWRITE is for writing user-formatted files, while WRITE and WRITELINE are for writing special formatted text files. XWRITE always appends to a file unless the file is RESET. Note that any time a WRITE or WRITELINE writes to a file, the file will automatically be a text file. No end of file marker is appended to files written only with XWRITE. In subsequent replications, additional items are appended to the end of the file unless the file is RESET. ProModel does not format the string expression, although you can use the FORMAT statement to manually format data. To add an end of file marker to a user-formatted file, use XWRITE CHAR(26).

Valid In

Any logic.

Components

<file ID>

The name of the file as previously defined in the External Files Editor.

<string or numeric expression>

The string expression to be written to the file.

Example

The following example uses XWRITE to record the time each Box completes processing at location Ship.

Process Table

Entity

Location

Operation (min)

Box

Ship

WAIT N(7.3,.4)

XWRITE Rpt, "Box Shipped at:" $ FORMAT(CLOCK(min),3,2)

Routing Table

Blk

Output

Destination

Rule

Move Logic

1

Dock

Doc

FIRST 1

MOVE FOR 5

See Also

WRITE, WRITELINE, and RESET. Also see External Files.